import React from 'react'
import {Button} from "antd";
import {ButtonProps} from "antd/lib/button/button";
import IconFont from "./icon";

interface ButtonType extends ButtonProps {
    fontSize?: string,
    bgColor?: string,
    padding?: string,
    border?: string,
    icon?: string,
    iconcolor?: string
}

export default function NoBorderButton(props: ButtonType) {


    const {children, fontSize = '14px', padding = '0', border = '0', icon, iconcolor = '#fff', bgColor} = props
    return (
        <div style={{
            backgroundColor: bgColor,
            margin: '0.5rem 0.8rem',

        }}>
            <Button type={'link'} {...props} icon={icon ? <IconFont color={iconcolor} type={icon}/> : null}
                    style={{
                        borderRadius: '0.8rem',
                        fontSize,
                        padding,
                        borderWidth: border,
                    }}>
                {children}
            </Button>
        </div>
    );
};
